/*
 * @Description: 设置响应头的中间件
 * @Author: zhihong deng
 * @Date: 2021-05-20 00:27:22
 * @LastEditors: zhihong deng
 * @LastEditTime: 2021-05-25 22:57:22
 */
module.exports = async (ctx,next) => {
    const contentType = 'application/json;charset=utf-8';
    ctx.set('content-Type',contentType);
    // 设置允许跨域
    ctx.set("Access-Control-Allow-Origin","*");
    ctx.set("Access-Control-Methods","OPTIONS,GET,PUT,POST,DELETE");
    await next()
}